package net.viral.struts2;

import java.sql.SQLException;

import webir.newsaggregator.ReadTest;

public class addcat {
	String category;
	String url;
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}

	public String execute() throws SQLException
	{
		Connect c=new Connect();
		String query;
		query="insert into linkcat(link,category) values('"+url+"','"+category+"')";
		c.getUpdate(query);
		//inserting the news into feedmessages
		try{
			new ReadTest().insertNewsFirstTime(url,category);
			SolrJUtils.doImport(true);
		}catch(Exception e){
			//
		}
		return "success";
	}
}
